import React,{ Component } from 'react'
import {observer,inject} from 'mobx-react'
import PropTypes from 'prop-types'

@inject('appState')
@observer
 class TopicList extends Component{
	constructor(){
		super()
		this.changeName=this.changeName.bind(this)
	}
	componentWillUpdate(){
		console.log('更新！')
	}
	changeName(event){
		this.props.appState.changeName(event.target.value)
	}
	render(){
		return (
			<div>
				<input type="text" onChange={this.changeName}/>
				<span>{this.props.appState.msg}</span>
			</div>
		)
	}
}export default TopicList

TopicList.propTypes={
	appState:PropTypes.object
}